package com.lx.pc.mybatis.repository.category;

import java.math.BigInteger;
import java.util.List;

import org.springframework.data.mybatis.repository.annotation.Query;
import org.springframework.data.mybatis.repository.support.MybatisRepository;
import org.springframework.stereotype.Repository;

import com.lx.pc.domain.entity.category.CategoryEntity;

@Repository("categoryRepository")
public interface CategoryRepository extends MybatisRepository<CategoryEntity, BigInteger>{

	/**
	 * 查询总数
	 */
	@Query("findByCategoryCount")
	public int findByCategoryCount(CategoryEntity category);
	
	/**
	 * 查询列表
	 * @param category
	 * @param page
	 * @param size
	 * @return
	 */
	@Query("findByCategory")
	public List<CategoryEntity> findByCategory(CategoryEntity category,Integer page,Integer size);
	
	/**
	 * 返回集合
	 * @param category
	 * @return
	 */
	@Query("findByCategoryList")
	public List<CategoryEntity> findByCategoryList(CategoryEntity category);
}
